﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MeetingPlate.aspx.cs" Inherits="Meeting.Web.Admin.MeetingPre.MeetingPlate" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <link href="../../Css/SmartWizard/smart_wizard.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Scripts/jquery-1.8.2.min.js"></script>
      <!--ardialog-->
    <script type="text/javascript" src="../../Scripts/artDialog4.1.6/artDialog.js?skin=blue"></script>
    <script type="text/javascript" src="../../Scripts/artDialog4.1.6/plugins/iframeTools.js"></script>
    <link href="../../Css/main.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="../../Scripts/themes/cupertino/easyui.css" />
    <link rel="stylesheet" type="text/css" href="../../Scripts/themes/icon.css" />
    <script type="text/javascript" src="../../Scripts/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../../Scripts/locale/easyui-lang-zh_CN.js"></script>
    <script src="../../Scripts/datagrid-detailview.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../Scripts/common.js"></script>
    <script src="../../Scripts/Json2.js" type="text/javascript"></script>
    <script type="text/javascript">
        var meetingId = request("Id");
        var CategoryId = request("CategoryId");
        $(function () {

            $("#MeetingName").html(unescape(request("Name")));
            InitMeetingPlate();
        });
        function InitMeetingPlate() {
            try {
                $("#meetingTopicPlate").datagrid({
                    url: 'MeetingOperation.ashx?method=GetSelectTopic&Id=' + meetingId,
                    singleSelect: true,
                    view: detailview,
                    detailFormatter: function (index, row) {
                        return '<div style="padding:2px"><table id="ddvmeetingTopicPlate-' + index + '"></table></div>';
                    },
                    onExpandRow: function (index, row) {
                        $('#ddvmeetingTopicPlate-' + index).datagrid({
                            url: 'MeetingOperation.ashx?method=GetMeetingTopicPlate&Id=' + row.TopicId,
                            nowrap: false,
                            singleSelect: true,
                            rownumbers: true,
                            loadMsg: '',
                            height: 'auto',
                            columns: [[
                                { field: 'Name', title: '地块名称', width: 385 },
                            { field: 'MeetingId', title: '', hidden: true },
                            { field: 'TopicId', title: '', hidden: true },
                            { field: 'PlateId', title: '', hidden: true },
                            { field: 'action', title: '操作', formatter: formatPlateDel }
                        ]],
                            onResize: function () {
                                $('#meetingTopicPlate').datagrid('fixDetailRowHeight', index);
                            },
                            onLoadSuccess: function () {
                                setTimeout(function () {
                                    $('#meetingTopicPlate').datagrid('fixDetailRowHeight', index);
                                }, 0);
                            }
                        });
                        $('#meetingTopicPlate').datagrid('fixDetailRowHeight', index);
                    }
                });
            } catch (ex) { }
        }
        function formatPlateDel(val, row) {
            return "<a href='#' class='easyui-linkbutton' onclick=\"RemoveMeetingPlate('" + row.MeetingId + "','" + row.TopicId + "','" + row.PlateId + "');\"  >移除</a> ";
        }
        function RemoveMeetingPlate(mId, tId, dId) {
            $.messager.confirm("询问", "确定要移除该文档吗？", function (c) {
                if (!c) return;
                var postData = { MeetingId: mId, TopicId: tId, PlateId: dId };
                $.post("MeetingOperation.ashx?method=DeleteMeetingTopicPlate", postData, function (data) {
                    if (data.success == true) {
                        $("#meetingTopicPlate").datagrid("reload");
                        $.messager.alert("提示", "删除成功");
                    } else {
                        $.messager.alert("提示", data.Message);
                    }
                });
            });
        }
        function AddMeetingTopicPlate(val, row) {
            return "<a href='#' class='easyui-linkbutton' onclick=\"AddMeetingPlate('" + row.MeetingId + "','" + row.TopicId + "');\"  >新增地块信息</a> ";
        }
        function AddMeetingPlate(meetingId, topicId) {
            var url = 'MeetingPlateFile.aspx?MeetingId=' + meetingId + '&TopicId=' + topicId;
            art.dialog.open(url, {
                id: 'AAA', width: 430, height: 380, lock: true,
                close: function () {
                    // var flag = art.dialog.data('result'); // 读取返回值True表示正确
                    $("#meetingTopicPlate").datagrid("reload");
                 
                }
            }, false);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table class="showView1" cellpadding="0" cellspacing="0" align="center">
            <tr>
                <td class="title">
                    会议名称:
                </td>
                <td class="td_Modify1" style="">
                    <span id="MeetingName"></span>
                </td>
            </tr>
            <tr>
                <td class="title">
                    已选议题:
                </td>
                <td class="td_Modify1" style="">
                    <table id="meetingTopicPlate" style="width: 500px; height: 360px;" singleselect="true"
                       nowrap="false"  fitcolumns="true">
                        <thead>
                            <tr>
                                <th data-options="field:'MeetingId',width:80,hidden:true">
                                    编号
                                </th>
                                <th data-options="field:'TopicId',width:80,hidden:true">
                                    编号
                                </th>
                                <th data-options="field:'Title',width:240">
                                    议题标题
                                </th>
                                <th data-options="field:'EmployeeId',width:100,hidden:true">
                                    人员编号
                                </th>
                                <th data-options="field:'EmployeeTitle',width:80,hidden:true">
                                    职务
                                </th>
                                <th data-options="field:'EmployeeName',width:60 ">
                                    主讲人
                                </th>
                                <th data-options="field:'RoleId',width:80,hidden:true">
                                </th>
                                <th data-options="field:'Sort',width:40,editor:'text'">
                                    排序
                                </th>
                                <th data-options="field:'action',width:80,formatter:AddMeetingTopicPlate">
                                </th>
                            </tr>
                        </thead>
                    </table>
                </td>
            </tr>
           <%-- <tr>
                <td class="title">
                </td>
                <td class="td_Modify1" style="">
                    <a href="#" class="easyui-linkbutton" onclick="SaveMeetingVote();">保存</a>
                </td>
            </tr>--%>
        </table>
    </div>
    </form>
</body>
</html>
